package com.jrx.anytxn.transaction.service;

import com.jrx.anytxn.common.exception.TxnBizException;
import com.jrx.anytxn.transaction.entity.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @program: anytxn-cf-transaction
 * @description: 还款分配历史表操作接口
 * @author: xiaoyu.jing
 * @date: 2019-10-16 12:40
 **/
public interface ITlPaymentAllocationLogService {

    /**
     * 构建08还款交易账户
     *
     * @param paymentLog
     * @param loanMainInfo
     * @param bussinessDate
     * @return
     */
    TlPaymentAllocationLog buildTlPaymentAllocationLog(TlPaymentLog paymentLog, AmLoanMainInfo loanMainInfo, Date bussinessDate) throws TxnBizException;

    /**
     * 构建09还款交易账户
     *
     * @param totalAllocationLog
     * @param amAccountMainInfo
     * @param realPaymentAmnt
     * @return
     */
    TlPaymentAllocationLog buildTlPaymentAllocationLog(TlPaymentAllocationLog totalAllocationLog, AmAccountMainInfo amAccountMainInfo, BigDecimal realPaymentAmnt) throws TxnBizException;


    /**
     * 根基账单分期关联表构建08还款交易账户
     *
     * @param tlLoanStagingMapping
     * @param loanMainInfo
     * @param bussinessDate
     * @return
     */
    TlPaymentAllocationLog buildTlPaymentAllocationLog(TlLoanStagingMapping tlLoanStagingMapping, AmLoanMainInfo loanMainInfo, Date bussinessDate) throws TxnBizException;

    /**
     * 构建08还款交易账户
     *
     * @param waivePaymentLog
     * @param loanMainInfo
     * @param bussinessDate
     * @return
     */
    TlPaymentAllocationLog buildTlPaymentAllocationLog(TlWaivePaymentLog waivePaymentLog, AmLoanMainInfo loanMainInfo, Date bussinessDate) throws TxnBizException;

    /**
     * 根据还款流水获取09还款交易账户
     * @param loanId
     * @param seqNo
     * @param customerId
     * @param tenantId
     * @return
     */
    List<TlPaymentAllocationLog> findCustLog(String loanId, String seqNo, String customerId, String tenantId);


    String getPaymentDetailTxnAccountTxnCode(String origleTxnCode, String payMentCode , String paymentType, String chargeoffFlag,String accountType);
}
